[XENOPROF] Fix oprofile for AMD SVM guests.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 1 Dec 2006 09:59:56 +0000 (09:59 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 1 Dec 2006 09:59:56 +0000 (09:59 +0000)
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/oprofile/op_model_athlon.c

index 1d8f9668f468a883db42257456ba77f2cc8ebc7b..ec99be48b0ae4588ebdf0ef06f3a8a8b493b5a3c 100644 (file)
@@ -113,14 +113,15 @@ static int athlon_check_ctrs(unsigned int const cpu,
        unsigned long eip = regs->eip;
        int mode = 0;
        struct vcpu *v = current;
-       struct cpu_user_regs tmp_regs;
+       struct cpu_user_regs *guest_regs = guest_cpu_user_regs();
 
        if (!guest_mode(regs) &&
            (regs->eip == (unsigned long)svm_stgi_label)) {
                /* SVM guest was running when NMI occurred */
-               hvm_store_cpu_guest_regs(v, &tmp_regs, NULL);
-               eip = tmp_regs.eip;
-               mode = xenoprofile_get_mode(v, &tmp_regs);
+               ASSERT(is_hvm_vcpu(v));
+               hvm_store_cpu_guest_regs(v, guest_regs, NULL);
+               eip = guest_regs->eip;
+               mode = xenoprofile_get_mode(v, guest_regs);
        } else {
                eip = regs->eip;
                mode = xenoprofile_get_mode(v, regs);